/**
 * Webpack入口
 * @author HuiSir q273250950
 * @git https://gitee.com/huisir001/
 * @blog http://www.zuifengyun.com/
 */
import ajax from './plugin/ajax.js'
import './css/common.css'
import './css/next.css'
import './css/swiper.min.css'
const {host} = require('../config')

//首页戏曲资料库分类点选ajax切换
$('#XQZLKCAT>li>a').click(function() {
	let catid = $(this)["0"].dataset.id
	ajax.get(`${host}t_data_content/list_page`,{page:1,size:10,categoryId:catid}).then(res=>{
		$('#XQZLKCAT>li>a').not($(this)).removeClass("cl")
		$(this).addClass('cl')
		let xqzlk_swiperHtml = ''
		res.data.forEach(item=>{
			xqzlk_swiperHtml+=`
				<div class="swiper-slide sw_lx" style="width: 192.4px; margin-right: 25px;">
					<a href="/detail/戏曲资料库_${item.id}.html"><img src="${host}resources/${item.image}"/></a>
					<p>${item.title}</p>
				</div>
			`
		})
		$('.xqzlk-swiper').html(xqzlk_swiperHtml)
	})
})

//首页支部建设分类点选ajax切换
$('#ZBJSCAT>li>a').click(function() {
	let catid = $(this)["0"].dataset.id
	ajax.get(`${host}t_party_content/list_page`,{page:1,size:10,categoryId:catid}).then(res=>{
		$('#ZBJSCAT>li>a').not($(this)).removeClass("cl")
		$(this).addClass('cl')
		let zbjs_swiperHtml = ''
		res.data.forEach(item=>{
			zbjs_swiperHtml+=`
				<div class="swiper-slide sw_lx" style="width: 192.4px; margin-right: 25px;">
					<a href="/detail/支部建设_${item.id}.html"><img src="${host}resources/${item.image}"/></a>
					<p>${item.title}</p>
				</div>
			`
		})
		$('.zbjs-swiper').html(zbjs_swiperHtml)
	})
})



